package org.wxl.domain;

import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.time.LocalDateTime;

/**
 * @author 王学良
 */
@Data
@AllArgsConstructor
@NoArgsConstructor
@TableName("cart")
public class cartEntity {
    /**
     * CREATE TABLE `cart` (
     *   `uuid` CHAR(36) NOT NULL COMMENT '购物车ID',
     *   `user_id` VARCHAR(32) NOT NULL COMMENT '用户ID',
     *   `product_id` CHAR(36) NOT NULL COMMENT '商品ID',
     *   `quantity` INT UNSIGNED NOT NULL DEFAULT 1 COMMENT '数量',
     *   `added_at` DATETIME DEFAULT CURRENT_TIMESTAMP COMMENT '添加时间',
     *   PRIMARY KEY (`uuid`)
     *   ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci COMMENT='购物车表';
     */
    @Schema(description = "购物车ID")
    @TableId
    private String uuid;

    @Schema(description = "用户ID")
    private String userId;

    @Schema(description = "商品ID")
    private String productId;

    @Schema(description = "数量")
    private Integer quantity;

    @Schema(description = "添加时间")
    private LocalDateTime addedAt;
}
